#include <stdio.h>
#include <signal.h>
#include <pthread.h>

/* handle SIGALRM signals */
void sign_alarm_handler(int signal_number)
{
	printf("Hi, I'm the sign_alarma_handler\n");
}

void *test_thread(void *parameters)
{
	printf("Im the thread. Welcome to my world.\n");
	
}

int main()
{

	struct sigaction sa;
	memset(&sa, 0, sizeof(sa));
	sa.sa_handler = &sign_alarm_handler;
	sigaction(SIGALRM, &sa, NULL);
	//signal(SIGALRM, &sign_alarm_handler); /* it's the same than 2 lines before */
	printf("watigind 3\n");
	sleep(3);
	kill(getpid(),SIGALRM);
	printf("waitinf 2\n");
	sleep(2);
	return 0;

}
